<?php
/**
 * 返回文件信息
 * User: fengyan
 * Date: 18-1-5
 * Time: 上午10:08
 */

namespace App\Repositories\Addons\Uploads;


class ReturnFileInfo
{
    /**
     * 原文件名称
     * @var
     */
    protected $original;

    /**
     * 新文件名称
     * @var
     */
    protected $title;

    /**
     * 新文件路径
     * @var
     */
    protected $path;

    protected $extension;

    protected $mime;

    protected $size;

    protected $md5;

    protected $dimensions = [];

    protected $links;

    public function __construct(array $data = [])
    {
        foreach ($data as $key=>$value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }

    public function getOriginal()
    {
        return $this->original;
    }

    public function getTitle()
    {
        return $this->title;
    }

    public function getPath()
    {
        return $this->path;
    }

    public function getExtension()
    {
        return $this->extension;
    }

    public function getMimeType()
    {
        return $this->mime;
    }

    public function getSize()
    {
        return $this->size;
    }

    public function getMd5()
    {
        return $this->md5;
    }

    public function getDimensions()
    {
        return $this->dimensions;
    }

    public function getLinks()
    {
        return $this->links;
    }
}